home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / livelabl / livelabe.exe / LTEXT.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-07-22  |  10.6 KB  |  332 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Live Text VB Example"
  5.    ClientHeight    =   5475
  6.    ClientLeft      =   1140
  7.    ClientTop       =   1515
  8.    ClientWidth     =   5745
  9.    Height          =   5880
  10.    Icon            =   "LText.frx":0000
  11.    Left            =   1080
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   5475
  16.    ScaleWidth      =   5745
  17.    ShowInTaskbar   =   0   'False
  18.    Top             =   1170
  19.    Width           =   5865
  20.    Begin VB.Frame Frame1 
  21.       Caption         =   "Live Text Control"
  22.       Height          =   4515
  23.       Left            =   45
  24.       TabIndex        =   0
  25.       Top             =   945
  26.       Width           =   5685
  27.       Begin VB.ComboBox cboLiveTextDirection 
  28.          Height          =   315
  29.          ItemData        =   "LText.frx":08CA
  30.          Left            =   135
  31.          List            =   "LText.frx":08DD
  32.          Style           =   2  'Dropdown List
  33.          TabIndex        =   19
  34.          Top             =   1935
  35.          Width           =   1455
  36.       End
  37.       Begin VB.Timer Timer1 
  38.          Interval        =   3000
  39.          Left            =   3915
  40.          Top             =   225
  41.       End
  42.       Begin VB.CheckBox chkLiveTextActive 
  43.          Caption         =   "&Active"
  44.          Height          =   240
  45.          Left            =   135
  46.          TabIndex        =   13
  47.          Top             =   270
  48.          Value           =   1  'Checked
  49.          Width           =   1590
  50.       End
  51.       Begin VB.CommandButton cmdLiveTextColor 
  52.          Caption         =   "&Label Color"
  53.          Height          =   375
  54.          Left            =   4410
  55.          TabIndex        =   12
  56.          Top             =   225
  57.          Width           =   1185
  58.       End
  59.       Begin VB.CommandButton cmdBorderColor 
  60.          Caption         =   "&Border Color"
  61.          Height          =   375
  62.          Left            =   4410
  63.          TabIndex        =   11
  64.          Top             =   630
  65.          Width           =   1185
  66.       End
  67.       Begin VB.CommandButton cmdTextColor 
  68.          Caption         =   "Text C&olor"
  69.          Height          =   375
  70.          Left            =   4410
  71.          TabIndex        =   10
  72.          Top             =   1035
  73.          Width           =   1185
  74.       End
  75.       Begin VB.CheckBox chkLiveTextChanged 
  76.          Caption         =   "Text &Changed Sound"
  77.          Height          =   240
  78.          Left            =   135
  79.          TabIndex        =   9
  80.          Top             =   585
  81.          Value           =   1  'Checked
  82.          Width           =   1950
  83.       End
  84.       Begin VB.CheckBox chkLiveTextChanging 
  85.          Caption         =   "Text C&hanging Sound"
  86.          Height          =   240
  87.          Left            =   135
  88.          TabIndex        =   8
  89.          Top             =   900
  90.          Value           =   1  'Checked
  91.          Width           =   2310
  92.       End
  93.       Begin VB.ComboBox cboBorderWidth 
  94.          Height          =   315
  95.          ItemData        =   "LText.frx":091A
  96.          Left            =   135
  97.          List            =   "LText.frx":0930
  98.          Sorted          =   -1  'True
  99.          Style           =   2  'Dropdown List
  100.          TabIndex        =   7
  101.          Top             =   2565
  102.          Width           =   1455
  103.       End
  104.       Begin VB.ComboBox cboSpeed 
  105.          Height          =   315
  106.          ItemData        =   "LText.frx":0946
  107.          Left            =   1665
  108.          List            =   "LText.frx":0959
  109.          Sorted          =   -1  'True
  110.          Style           =   2  'Dropdown List
  111.          TabIndex        =   6
  112.          Top             =   1935
  113.          Width           =   1005
  114.       End
  115.       Begin VB.CommandButton cmdExit 
  116.          Caption         =   "E&xit"
  117.          Height          =   330
  118.          Left            =   4455
  119.          TabIndex        =   5
  120.          Top             =   4095
  121.          Width           =   1140
  122.       End
  123.       Begin VB.ComboBox cboFont 
  124.          Height          =   315
  125.          ItemData        =   "LText.frx":096C
  126.          Left            =   1665
  127.          List            =   "LText.frx":0973
  128.          Sorted          =   -1  'True
  129.          Style           =   2  'Dropdown List
  130.          TabIndex        =   4
  131.          Top             =   2565
  132.          Width           =   2130
  133.       End
  134.       Begin VB.TextBox txtMessage 
  135.          Height          =   330
  136.          Left            =   180
  137.          MaxLength       =   50
  138.          TabIndex        =   3
  139.          Text            =   "Live Text Control"
  140.          Top             =   4095
  141.          Width           =   3615
  142.       End
  143.       Begin VB.CommandButton cmdApply 
  144.          Caption         =   "&Apply"
  145.          Height          =   330
  146.          Left            =   2970
  147.          TabIndex        =   2
  148.          Top             =   3735
  149.          Width           =   825
  150.       End
  151.       Begin VB.ComboBox cboDelay 
  152.          Height          =   315
  153.          ItemData        =   "LText.frx":0986
  154.          Left            =   2745
  155.          List            =   "LText.frx":099F
  156.          Style           =   2  'Dropdown List
  157.          TabIndex        =   1
  158.          Top             =   1935
  159.          Width           =   1050
  160.       End
  161.       Begin VB.Label Label1 
  162.          AutoSize        =   -1  'True
  163.          Caption         =   "Text Direction"
  164.          Height          =   195
  165.          Left            =   135
  166.          TabIndex        =   20
  167.          Top             =   1710
  168.          Width           =   990
  169.       End
  170.       Begin MSComDlg.CommonDialog dlgMain 
  171.          Left            =   3375
  172.          Top             =   180
  173.          _ExtentX        =   847
  174.          _ExtentY        =   847
  175.          _Version        =   327681
  176.       End
  177.       Begin VB.Label Label2 
  178.          AutoSize        =   -1  'True
  179.          Caption         =   "Border Width"
  180.          Height          =   195
  181.          Left            =   135
  182.          TabIndex        =   18
  183.          Top             =   2340
  184.          Width           =   930
  185.       End
  186.       Begin VB.Label Label4 
  187.          AutoSize        =   -1  'True
  188.          Caption         =   "Text Speed"
  189.          Height          =   195
  190.          Left            =   1665
  191.          TabIndex        =   17
  192.          Top             =   1710
  193.          Width           =   825
  194.       End
  195.       Begin VB.Label Label5 
  196.          AutoSize        =   -1  'True
  197.          Caption         =   "Font"
  198.          Height          =   195
  199.          Left            =   1665
  200.          TabIndex        =   16
  201.          Top             =   2340
  202.          Width           =   315
  203.       End
  204.       Begin VB.Label Label6 
  205.          AutoSize        =   -1  'True
  206.          Caption         =   "Message"
  207.          Height          =   195
  208.          Left            =   180
  209.          TabIndex        =   15
  210.          Top             =   3870
  211.          Width           =   645
  212.       End
  213.       Begin VB.Label Label7 
  214.          AutoSize        =   -1  'True
  215.          Caption         =   "Text Delay"
  216.          Height          =   195
  217.          Left            =   2745
  218.          TabIndex        =   14
  219.          Top             =   1710
  220.          Width           =   765
  221.       End
  222.    End
  223.    Begin LiveLabelsLib.LiveText LiveText1 
  224.       Height          =   780
  225.       Left            =   45
  226.       TabIndex        =   21
  227.       Top             =   90
  228.       Width           =   4380
  229.       _Version        =   65536
  230.       _ExtentX        =   7726
  231.       _ExtentY        =   1376
  232.       _StockProps     =   8
  233.       BorderWidth     =   2
  234.       Message         =   "Live Text"
  235.       BeginProperty LiveTextFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  236.          Name            =   "Comic Sans MS"
  237.          Size            =   24.01
  238.          Charset         =   0
  239.          Weight          =   700
  240.          Underline       =   0   'False
  241.          Italic          =   0   'False
  242.          Strikethrough   =   0   'False
  243.       EndProperty
  244.       BorderColor     =   128
  245.    End
  246. Attribute VB_Name = "frmMain"
  247. Attribute VB_Creatable = False
  248. Attribute VB_Exposed = False
  249. Option Explicit
  250. Private Sub cboBorderWidth_Click()
  251.     LiveText1.BorderWidth = Val(cboBorderWidth.List(cboBorderWidth.ListIndex))
  252. End Sub
  253. Private Sub cboDelay_Click()
  254.     LiveText1.LiveTextDelay = Val(cboDelay.List(cboDelay.ListIndex))
  255. End Sub
  256. Private Sub cboFont_Click()
  257.     LiveText1.LiveTextFont.Name = cboFont.List(cboFont.ListIndex)
  258. End Sub
  259. Private Sub cboSpeed_Click()
  260.     LiveText1.LiveTextSpeed = Val(cboSpeed.List(cboSpeed.ListIndex))
  261. End Sub
  262. Private Sub cboLiveTextDirection_Click()
  263.     LiveText1.LiveTextDirection = cboLiveTextDirection.ListIndex
  264.      
  265. End Sub
  266. Private Sub chkLiveTextActive_Click()
  267.     Timer1.Enabled = (chkLiveTextActive.Value = 1)
  268. End Sub
  269. Private Sub chkLiveTextChanged_Click()
  270.     With LiveText1
  271.         If (chkLiveTextChanged.Value = 0) Then
  272.             .SoundWhenChanged = ""
  273.         Else
  274.             .SoundWhenChanged = App.Path & "\" & "Tick.WAV"
  275.         End If
  276.     End With
  277. End Sub
  278. Private Sub chkLiveTextChanging_Click()
  279.     With LiveText1
  280.         If (chkLiveTextChanging.Value = 0) Then
  281.             .SoundWhenChanging = ""
  282.         Else
  283.             .SoundWhenChanging = App.Path & "\" & "Tick.WAV"
  284.         End If
  285.     End With
  286. End Sub
  287. Private Sub cmdApply_Click()
  288.     LiveText1.Message = txtMessage.Text
  289. End Sub
  290. Private Sub cmdBorderColor_Click()
  291.     With dlgMain
  292.       .Action = 3
  293.       If .CancelError Then Exit Sub
  294.       LiveText1.BorderColor = .Color
  295.     End With
  296. End Sub
  297. Private Sub cmdExit_Click()
  298.     Unload Me
  299. End Sub
  300. Private Sub cmdTextColor_Click()
  301.     With dlgMain
  302.       .Action = 3
  303.       If .CancelError Then Exit Sub
  304.       LiveText1.ForeColor = .Color
  305.     End With
  306. End Sub
  307. Private Sub cmdLiveTextColor_Click()
  308.     With dlgMain
  309.       .Action = 3
  310.       If .CancelError Then Exit Sub
  311.       LiveText1.LiveTextColor = .Color
  312.     End With
  313. End Sub
  314. Private Sub Form_Load()
  315.     chkLiveTextChanged_Click
  316.     chkLiveTextChanging_Click
  317.     cboFont.ListIndex = 0
  318.     cboLiveTextDirection.ListIndex = 1
  319.     cboSpeed.ListIndex = 0
  320.     cboDelay.ListIndex = 0
  321.     cboBorderWidth.ListIndex = 2
  322.     Dim Cnt As Long
  323.     For Cnt = 0 To Screen.FontCount
  324.       cboFont.AddItem Screen.Fonts(Cnt)
  325.     Next
  326. End Sub
  327. Private Sub Timer1_Timer()
  328.     Static Cnt As Long
  329.     Cnt = Cnt + 1
  330.     LiveText1.Message = "Live Text " & Cnt
  331. End Sub
  332.